package com.yinhe.system.service.impl;

import java.util.List;

import com.yinhe.common.annotation.DataScope;
import com.yinhe.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.yinhe.system.mapper.YhInspectionMapper;
import com.yinhe.system.domain.YhInspection;
import com.yinhe.system.service.IYhInspectionService;

/**
 * 查铺记录Service业务层处理
 * 
 * @author yinhe
 * @date 2022-07-20
 */
@Service
public class YhInspectionServiceImpl implements IYhInspectionService 
{
    @Autowired
    private YhInspectionMapper yhInspectionMapper;

    /**
     * 查询查铺记录
     * 
     * @param id 查铺记录主键
     * @return 查铺记录
     */
    @Override
    public YhInspection selectYhInspectionById(Long id)
    {
        return yhInspectionMapper.selectYhInspectionById(id);
    }

    /**
     * 查询查铺记录列表
     * 
     * @param yhInspection 查铺记录
     * @return 查铺记录
     */
    @Override
    @DataScope(deptAlias = "yh_inspection", userAlias = "yh_inspection")
    public List<YhInspection> selectYhInspectionList(YhInspection yhInspection)
    {
        return yhInspectionMapper.selectYhInspectionList(yhInspection);
    }

    /**
     * 新增查铺记录
     * 
     * @param yhInspection 查铺记录
     * @return 结果
     */
    @Override
    public int insertYhInspection(YhInspection yhInspection)
    {
        yhInspection.setCreateTime(DateUtils.getNowDate());
        return yhInspectionMapper.insertYhInspection(yhInspection);
    }

    /**
     * 修改查铺记录
     * 
     * @param yhInspection 查铺记录
     * @return 结果
     */
    @Override
    public int updateYhInspection(YhInspection yhInspection)
    {
        yhInspection.setUpdateTime(DateUtils.getNowDate());
        return yhInspectionMapper.updateYhInspection(yhInspection);
    }

    /**
     * 批量删除查铺记录
     * 
     * @param ids 需要删除的查铺记录主键
     * @return 结果
     */
    @Override
    public int deleteYhInspectionByIds(Long[] ids)
    {
        return yhInspectionMapper.deleteYhInspectionByIds(ids);
    }

    /**
     * 删除查铺记录信息
     * 
     * @param id 查铺记录主键
     * @return 结果
     */
    @Override
    public int deleteYhInspectionById(Long id)
    {
        return yhInspectionMapper.deleteYhInspectionById(id);
    }
}
